<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<fmt:setBundle basename="ApplicationResources" />
<title><fmt:message key="label.crudschedule" /> </title>
<script type="text/javascript" src="/phoenix/js/jquery-1.2.3.min.js"></script>
<script type="text/javascript" src="/phoenix/js/windowmsg/jquery.windowmsg-1.0.js"></script>
<script type="text/javascript" src="/phoenix/js/select-user.js"></script>
<script type="text/javascript" src="/phoenix/js/select-schedule.js"></script>
</head>
<body>
	<form action="${pageContext.request.contextPath}/controller/setupschedule"
		method=post>
		<center>
			<table cellpadding=4 cellspacing=2 border=0>
				<tr>
					<th width="30%"><fmt:message key="label.crudschedule.add" /></th>
					<th width="45%"></th>

				</tr>
				<tr>
					<td>
					  <c:if test="${insert == 'true'}">
							<input type="hidden" name="ins" value="true" />
						</c:if> 
						 <c:if test="${insert == 'false'}">
							<input type="hidden" name="ins" value="false" />
						</c:if> 
		            </td>
				    <td>		
						<input type="hidden" name="schedule_id" value="${schedule.scheduleId}" />
			    	</td>
				</tr>
				<tr>
					<td><fmt:message key="label.crudschedule.program_name" /></td>
					<td>
					    <c:if test="${insert == 'true'}">
					      <select name="program_id">
							<c:forEach var="program" items="${programs}" varStatus="status">
								  <option value="${program.program_id}"> ${program.name}</option>
							</c:forEach>
							</select>
							<input type="hidden" name="ins" value="true" />
							
						</c:if> 
						<c:if test="${insert == 'false'}">
							<input type="hidden" name="ins" value="true" />
							<input type="text" name="program_name" value="${schedule.program.name}"
						size=45 maxlength=20 disabled="disabled" required>
						<input type="hidden" name="program_id" value="${schedule.program.program_id}" />
						</c:if> 
						
						</td>
				</tr>
				<tr>
					<td><fmt:message key="label.crudschedule.start_time" /></td>
					<td><input type="text" name="start_time" id="start_time"
						value="${schedule.startTime}" size=15 maxlength=20 required> <font color="red">*</font>
					    <input type="button" id="schedule-button"
						value="?" >						
						</td>
				</tr>

				<tr>
					<td><fmt:message key="label.crudschedule.end_time" /></td>
					<td><input type="text" name="end_time" id="end_time"
						value="${schedule.endTime}" size=15 maxlength=20 required> <font color="red">*</font> </td>
				</tr>
				
				<tr>
					<td><fmt:message key="label.crudschedule.presenter" /></td>
					<td><input type="text" name="presenter" id="presenter-text"
						value="${schedule.presenter.name}" size=15 maxlength=20 required> <font color="red">*</font>
						<input type="button" id="presenter-button"
						value="?" >
						<input type="hidden" name="presenterId" id="presenter-id"
						value="${schedule.presenter.id}" size=15 maxlength=20>
						</td>
				</tr>
				
				<tr>
					<td><fmt:message key="label.crudschedule.producer" /></td>
					<td><input type="text" name="producer" id="producer-text"
						value="${schedule.producer.name}" size=15 maxlength=20 required> <font color="red">*</font>
						<input type="button" id="producer-button"
						value="?" >
						<input type="hidden" name="producerId" id="producer-id"
						value="${schedule.producer.id}" size=15 maxlength=20>
						</td>
				</tr>
				
   		</table>
		</center>
		<input type="submit" value="Submit"> <input type="reset"
			value="Reset">
	</form>


</body>
</html>